﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master" Inherits="System.Web.Mvc.ViewPage<AnalisisDeRiesgos.Models.Report.ScheduleModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Agenda de actividades
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            function getSchedule() {
                $.get("/Report/GetScheduleFromDate/" + $("#TheDate").val(), function (htmlResult) {
                    $("#Schedule").remove();
                    $("#content").append(htmlResult);
                });
            }
            getSchedule();
            $("#date").datepicker({ dateFormat: 'dd-mm-yy',
                numberOfMonths: 3,
                onSelect: function (dateText, inst) {
                    $("#TheDate").val(dateText);
                    getSchedule();
                }
            });           

            $("#date").datepicker("setDate", $("#TheDate").val());
        });
    </script>
    <h2>Agenda de actividades</h2>    
    <% using (Html.BeginForm())
    {%>
        <%: Html.ValidationSummary(true) %>
        <fieldset>
            <legend>Fecha</legend>
            <div id="date" />            
            <%: Html.HiddenFor(model => model.TheDate, new { enabled = "false" })%>                            
        </fieldset>
    <% } %>
    <div id = "content" />
</asp:Content>

